<?php
namespace Home\Controller;
use Think\Controller;

/**
 * 升级
 */
class AppController extends Controller{
	/**
	 * 安卓机器升级接口
	 */
	  public function Android(){
        $where['type']='android';
        $temp=M('app')->where($where)->getField("key,val");
        if(!empty($temp)){
        	$temp['status']=1;
        	echo json_encode($temp);
        }else{
        	$res['status']=0;
            $res['msg']='请管理员设置app 版本号';
             echo json_encode($res,JSON_UNESCAPED_UNICODE);
        }

    }
    /**
     * 手机升级
     */

      public function Androidmobile(){
        $where['type']='amobile';
        $temp=M('app')->where($where)->getField("key,val");
        if(!empty($temp)){
            $temp['status']=1;
            echo json_encode($temp);
        }else{
            $res['status']=0;
            $res['msg']='请管理员设置app 版本号';
             echo json_encode($res,JSON_UNESCAPED_UNICODE);
        }

    }
    /**
     * 平板升级
     */
     public function Androidpad(){
        $where['type']='apad';
        $temp=M('app')->where($where)->getField("key,val");
        if(!empty($temp)){
            $temp['status']=1;
            echo json_encode($temp);
        }else{
            $res['status']=0;
            $res['msg']='请管理员设置app 版本号';
             echo json_encode($res,JSON_UNESCAPED_UNICODE);
        }

    }





    /**
	 * ios升级接口
	 */
	  public function Ios(){
        $where['type']='ios';
        $temp=M('app')->where($where)->getField("key,val");
        if(!empty($temp)){
        	$temp['status']=1;
        	echo json_encode($temp);
        }else{
        	$temp['status']=0;
            $temp['msg']=urlencode('请管理员设置app 版本号');
             echo json_encode($temp);
        }

    }


}